﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectOperate.aspx.cs"
    Inherits="MsgCenter.Web.Pages.Module.SelectOperate" MasterPageFile="~/Option.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="server">
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/bootstrap.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/jquery.jqGrid.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/i18n/grid.locale-cn.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/myJqgrid.js") %>"></script>
    <script type="text/javascript">
        var id = 'grid-table';
        jQuery(function ($) {
            var url = "../../Handlers/Handler_Operate.ashx?method=GetSelectOperateList&ModuleID=<%=strDeptGuID %>";
            var datatype = 'json';
            var colNames = ['OperateID', '功能名称', '功能值', '功能描述', '样式名称', '是否删除', '创建日期'];
            var colModel = [
				{ name: 'OperateID', index: 'OperateID', width: 60, editable: false, hidden: true },
				{ name: 'OperateName', index: 'OperateName', width: 50, editable: false },
				{ name: 'OperateValue', index: 'OperateValue', width: 50, editable: false },
                { name: 'OperateDes', index: 'OperateDes', width: 80, editable: false },
                { name: 'CssCss', index: 'CssCss', width: 50, editable: false },
                { name: 'IsDelete', index: 'IsDelete', width: 40, editable: false,
                    formatter: function (value) {
                        if (value.toString() == "True") {
                            return "是";
                        }
                        else {
                            return "否";
                        }
                    }
                },
				{ name: 'CreateDate', index: 'CreateDate', width: 60, editable: false, formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d'} },
			];
            var caption = '功能列表';
            var sortname = 'CreateDate';
            myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, 'desc', null, 1000, true, 292, null, null, null);
        });
        function CheckSubmit() {
            var row = jQuery("#" + id).jqGrid('getGridParam', 'selarrrow');
            var len = row.length;
            var selectUserID = "";
            for (var i = 0; i < len; i++) {
                var model = jQuery("#" + id).jqGrid('getRowData', row[i]);
                if (selectUserID == "") {
                    selectUserID = model.OperateID;
                }
                else {
                    selectUserID += "," + model.OperateID;
                }
            }
            window.parent.SaveModuleOperate(selectUserID);
        }     
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="mailContent">
    <div style="text-align: center">
        <asp:LinkButton ID="linkSave" runat="server" CssClass="btn btn-info" OnClientClick="return CheckSubmit();"><i class="icon-ok bigger-110"></i>保存</asp:LinkButton>
        &nbsp;&nbsp;
        <button class="btn" onclick="window.parent.CBClose();return false;">
            <i class="icon-undo bigger-110"></i>取消
        </button>
    </div>
    <table id="grid-table">
    </table>
    <div id="grid-pager">
    </div>
    <div id="dialog-confirm" class="hide">
        <div class="space-6">
        </div>
        <p class="bigger-110 bolder center grey">
            <i class="icon-hand-right blue bigger-120"></i>请确定是否删除?
        </p>
    </div>
</asp:Content>
